<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="https://cdn.staticfile.org/vue/2.4.2/vue.min.js"></script>
</head>
<body>
<div id="app">
    年齡：<input type="number" v-model="age"><br>
    提示信息：<span>{{infoMsg}}</span>
</div>

<script type="text/javascript">
    var vm = new Vue({
        el: '#app',
        data: {
            age: 0,
            infoMsg: ""
        },
        watch: {
            age: function (val, oldval) {
                if (val > 0 && val < 15) {
                    this.infoMsg = "你还是个小孩"
                } else if (val > 15 && val < 25) {
                    this.infoMsg = "你已经是个少年"
                } else {
                    this.infoMsg = "你已经长大了"
                }
            }
        }
    })
</script>
</body>
</html>